package daemothread;

/**
 * @description:
 * @author: jhy
 * @time: 2021/4/12 14:03
 */

//线程先执行start方法，后通过setDaemo(true)设置为守护线程，会抛出非法线程状态的异常
public class ExceptionDemo1 {

    public static void main(String[] args) {
        MyThread1 myThread1 = new MyThread1();
        myThread1.start();
        myThread1.setDaemon(true);
    }
}

class MyThread1 extends Thread{

    @Override
    public void run() {
        super.run();
    }
}
